onBeforeUpdateRow Event

Arguments

dataobject

Contains the row's updated data.

indexnumber

A zero-based row number of the row to be updated.

Description

Fires when the .updateRow() method is called before the rows are actually updated.

Discussion

The onBeforeUpdateRow event can be used to perform additional validation before a row is updated. The <listObj>.updateRow() call can be cancelled by returning false. For example:

Example

// last name cannot blank:
if (($u.s.aTrim(data["lastname"])).length == 0) {
    alert("lastname cannot be blank. Row "+index+" will not be updated.");
    return false;
}

See Also